//
//  EntityViewComponent.m
//  TengineTwo
//
//  Created by StandardUser on 10/02/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.

#import "EntityViewComponent.h"
#import "CGPointExtension.h"

@implementation EntityViewComponent

//entity protocol (scale position and rotation are implemented in cCNode base class)

@synthesize cachedTag;
@synthesize type;
@synthesize origin;

//http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:sprites
-(id) initWithTexture:(CCTexture2D*)texture rect:(CGRect)rect
{
    if( (self=[super initWithTexture:texture rect:rect]))
    {
        self.position = ccp(0,0);
        self.rotation = 0;
        self.scale = 1.0;
        
        //lazy initialiser
        self.cachedTag = nil;
    }
    return self;
}

#pragma mark poolable protocol

-(void)clean
{
    self.position = ccp(0,0);
    self.rotation = 0;
    self.scale = 1.0;
    
    //lazy initialiser
    self.cachedTag = nil;
}

#pragma mark wrapper accessors to shut the compiler up

-(void)setScale:(float)value
{
    [super setScale:value];
}
-(float)scale
{
    return [super scale];
}

-(void)setRotation:(float)value
{
    [super setRotation:value];
}
-(float)rotation
{
    return [super rotation];
}

-(void)setPosition:(CGPoint)value
{
    [super setPosition:value];
}
-(CGPoint)position
{
    return [super position];
}

@end
